import { IsNotEmpty } from 'class-validator';
import { ApiPropertyOptional } from '@nestjs/swagger';

export class SignInDto {
  @IsNotEmpty({ message: '登陆方式不能为空' })
  @ApiPropertyOptional({
    description: '登陆方式1.用户名+密码 2手机+验证码 3微信登陆',
    type: String,
    default: '1',
  })
  mode: string;

  @IsNotEmpty({ message: '用户名不能为空' })
  @ApiPropertyOptional({
    description: '用户名',
    type: String,
    default: 'zhangyalin',
  })
  username: string;

  @IsNotEmpty({ message: '密码不能为空' })
  @ApiPropertyOptional({
    description: '密码',
    type: String,
    default: '123456',
  })
  password: string;

  @ApiPropertyOptional({
    description: '手机号',
    type: String,
    default: '123456',
  })
  telphone: string;

  @ApiPropertyOptional({
    description: '验证码',
    type: String,
    default: '123456',
  })
  validate_code: string;

  @ApiPropertyOptional({
    description: '邮箱',
    type: String,
    default: 'changeme',
  })
  email: string;

  @ApiPropertyOptional({
    description: '微信登陆openid',
    type: String,
    default: 'changeme',
  })
  openid: string;
}
